<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Page title -->
    <title>Petz - Pet HTML5 Template</title>
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/foreground/js/respond.js"></script>
    <![endif]-->
    <!-- Bootstrap Core CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/bootstrap.css" rel="stylesheet" type="text/css">
    <!-- Icon fonts -->
    <link href="${pageContext.request.contextPath}/foreground/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/flaticons/flaticon.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/glyphicons/bootstrap-glyphicons.css" rel="stylesheet" type="text/css">
    <!-- Google fonts -->
    <link href="https://fonts.googleapis.com/css?family=Lato:400,800" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Baloo+Thambi" rel="stylesheet">
    <!-- Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/style.css" rel="stylesheet">
    <!-- Plugins CSS -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/foreground/css/plugins.css">
    <!-- Color Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/styles/maincolors.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/background/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/js/xadmin.js"></script>

</head>
<body>
<%--导航栏--%>
<%@ include file="../common/topbar.jsp" %>


<section class="callout container-fluid no-padding">
    <div class="jumbotron" data-stellar-background-ratio="0.5">
        <!-- Heading -->
        <div class="jumbo-heading" data-stellar-background-ratio="1.2">
            <h1>流浪求助</h1>
        </div>
    </div>
    <div class="row-fluid">
        <!-- 左边男人抱猫狗的图片-->
        <div class="col-lg-8 col-md-12 no-padding" data-start="right: 20%;"
             data-center="right:0%;">
            <img src="${pageContext.request.contextPath}/foreground/img/call1.jpg" class="img-responsive img-rounded" alt="">
        </div>
        <!-- 右边文字和按钮部分-->
        <div class="callout-box col-lg-6 col-lg-offset-6 bg-darkcolor"  data-start="left: 20%;"
             data-center="left:0%;">
            <h3>预约</h3>
            <!-- Form表单-->
            <div id="contact_form">
                <form class="form-group" onsubmit="return false" id="addReserve">
                    <h6><label>用户名<span class="required">*</span></label></h6>
                    <input type="text" name="reUid" value="${userid}" class="form-control input-field" required="" readonly=“readonly”>
                    <h6><label>求助类型<span class="required">*</span></label></h6>
                    <input type="text" name="reType" value="${reType}" class="form-control input-field" required="" readonly=“readonly”>
                    <h6><label>预约开始时间<span class="required">*</span></label></h6>
                    <input type="datetime-local" name="reTime" class="form-control input-field" required="">
                    <h6><label>预约时长<span class="required">*</span></label></h6>
                    <input type="text" name="reDuration" class="form-control input-field" required="">


                </form>
                <button onclick="addReserve()" type="submit" id="submit_btn" value="Submit" class="btn center-block">预约</button>
            </div>
        </div>
    </div>
</section>
<script>
    function addReserve(){
        layer.confirm('确认要预约吗？',function(index){
            //发异步删除数据
            $.ajax({
                url:"addReserve",
                data:$('#addReserve').serialize(),//servlet按照"classobj_id"取值
                type:"POST",
                success:function(s){//从servlet获取返回数据data:{SUCCESS ERREO}
                    if(s=="SUCCESS"){
                        layer.msg('预约成功!',{icon:1,time:1000});
                    }else{
                        layer.alert(s,{title:"预约失败"});
                    }
                }
            });
        });
    }
</script>
</body>
</html>
